this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.Ui=this.BX.Landing.Ui||{};this.BX.Landing.Ui.Panel=this.BX.Landing.Ui.Panel||{};this.BX.Landing.Ui.Panel.Formsettingspanel=this.BX.Landing.Ui.Panel.Formsettingspanel||{};(function(e,t,n,a,i,r,s,o){"use strict";function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){babelHelpers.defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=function(e){babelHelpers.inherits(t,e);function t(e){var s;babelHelpers.classCallCheck(this,t);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));s.setEventNamespace("BX.Landing.UI.Panel.FormSettingsPanel.DefaultValues");var l=new i.HeaderCard({title:r.Loc.getMessage("LANDING_FORM_SETTINGS_DEFAULT_VALUE_TITLE")});var p=new o.MessageCard({id:"defaultValueMessage",header:r.Loc.getMessage("LANDING_FORM_SETTINGS_DEFAULT_VALUE_MESSAGE_TITLE"),description:r.Loc.getMessage("LANDING_FORM_SETTINGS_DEFAULT_VALUE_MESSAGE_DESCRIPTION"),restoreState:true});var c=new n.FormSettingsForm({fields:[new a.DefaultValueField({selector:"presetFields",isLeadEnabled:s.options.isLeadEnabled,personalizationVariables:s.getPersonalizationVariables(),formOptions:d({},s.options.formOptions),crmFields:d({},s.options.crmFields),dictionary:d({},s.options.dictionary),items:babelHelpers.toConsumableArray(s.options.formOptions.presetFields)})]});if(!p.isShown()){c.setOffsetTop(-36)}p.subscribe("onClose",(function(){c.setOffsetTop(-36)}));s.addItem(l);s.addItem(p);s.addItem(c);return s}babelHelpers.createClass(t,[{key:"getPersonalizationVariables",value:function e(){var t=this;return this.cache.remember("personalizationVariables",(function(){var e=t.options.dictionary.properties;if(s.Type.isPlainObject(e)&&s.Type.isArrayFilled(e.list)){return e.list.map((function(e){return{name:e.name,value:e.id}})).concat([{delimiter:true}]).concat(t.options.formOptions.data.fields.filter((function(e){return["phone","email","date","datetime","double","integer","lastname","name","secondname","string","text","money"].includes(e.type)})).map((function(e){return{name:e.label,value:"%".concat(e.name.toLowerCase(),"%")}})))}return[]}))}},{key:"getLayout",value:function e(){var n=babelHelpers.get(babelHelpers.getPrototypeOf(t.prototype),"getLayout",this).call(this);s.Dom.addClass(n,"landing-ui-default-fields-values");return n}},{key:"onChange",value:function e(t){this.emit("onChange",d(d({},t.getData()),{},{skipPrepare:true}))}}]);return t}(t.ContentWrapper);e.default=p})(this.BX.Landing.Ui.Panel.Formsettingspanel.Content=this.BX.Landing.Ui.Panel.Formsettingspanel.Content||{},BX.Landing.UI.Panel,BX.Landing.UI.Form,BX.Landing.UI.Field,BX.Landing.UI.Card,BX.Landing,BX,BX.Landing.UI.Card);
//# sourceMappingURL=default-values.bundle.map.js